#ifndef TEST_NOTIFICATION_MANAGER_TEST_H
#define TEST_NOTIFICATION_MANAGER_TEST_H
#include "RquestType.h"
#include "PrintInfo.h"
#include"Server.h"
#include<iostream>


void Test_regularly_save_notify_to_file(){
    
    thread t(&NotificationManager::SaveNotifyToFile_regularly, NotificationManager::get_instance(), 10);

    while(true){
        cout<<"notify_type> ";
        int notify_type;
        cin>>notify_type;

        cout<<endl<<"receiver_id> ";
        int receiver_id;
        cin>>receiver_id;

        cout<<endl<<"sender_id> ";
        int sender_id;
        cin>>sender_id;

        cout<<endl<<"chat_room_id> ";
        string chat_room_id;
        cin>>chat_room_id;

        cout<<endl<<"content> ";
        string content;
        cin>>content;

        cout<<endl<<"time> ";
        string time;
        cin>>time;

        if(notify_type==static_cast<int>(NotifyType::INVITE_RESULT_NOTIFY)){
            cout<<endl<<"invite_result> ";
            int invite_result;
            cin>>invite_result;
            NotificationManager::get_instance()->add_notify(receiver_id, make_unique<InviteResultNotify>(sender_id, receiver_id, chat_room_id, content, time, invite_result));
        }
        else{
           NotificationManager::get_instance()->add_notify(receiver_id,create_notify(static_cast<NotifyType>(notify_type), chat_room_id, content, time, sender_id, receiver_id));
        }

    }
}






#endif
